<?
/**************************************************************************************************
操作命令数组
**************************************************************************************************/
$cmdName = Array(
	"add"		=>"内容新增",
	"edit"		=>"内容修改",
	"delete"	=>"删除记录",
	"list"		=>"内容列表",
	"editlcustomer"=>"潜在客户",
	"editcustomer"=>"客户资料"
);
/**************************************************************************************************
接收当前页基本操作命令
**************************************************************************************************/
function get_cmd()
{
	$cmd		= '';
	if(isset($_GET['cmd']))
		$cmd	= $_GET['cmd'];
	$cmd = strtolower($cmd);
	return $cmd;
}
/**************************************************************************************************
页眉
**************************************************************************************************/
function Base_Page_Header()
{
	if(!isset($_SESSION['REEYEE_MANAGE']) || 
		!isset($_SESSION['REEYEE_MANAGE']['user']) || 
		$_SESSION['REEYEE_MANAGE']['user'] == '')
	{
		header("Location: login.php");
		exit;
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=CHARSET?>">
<title><?=MANAGE_TITLE?></title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language="javascript" src="js/std.js"></script>
<script language="javascript" src="js/wfloat.js"></script>
</head>
<body>
<table width="1000" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td background="images/back_r1_c1.jpg" height="65" colspan="2"></td>
  </tr>
</table>
<table width="1000" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="120" height="8" background="images/back_r3_c1.jpg">&nbsp;</td>
    <td width="815" bgcolor="#EFEFEF" align="right" valign="middle">
    	<table border="0" cellspacing="0" cellpadding="0" align="right">
    	<tr>
		   <td><a href="<?=ATHENA_SCRIPT_INDEX?>"><img src="images/desk.gif" border="0"></a></td>
		   <td width="20"></td>
		 </tr>
	   </table>
    </td>
  </tr>
  <tr>
    <td width="186" align="center" valign="top" background="images/back_r3_c1.jpg">
<?
}
/**************************************************************************************************
页脚
**************************************************************************************************/
function Base_Page_Foot()
{
?>
		  </td>
		</tr>
	  </table>
	</td>
  </tr>
  <tr bgcolor="#ACADAF">
    <td height="1" colspan="2" align="center" valign="top"></td>
  </tr>
  <tr bgcolor="#ECECEC">
    <td height="28" colspan="2" align="center" valign="middle"><div class="word">manage copyright 2005</div></td>
  </tr>
</table>
</body>
</html>
<?
}
/**************************************************************************************************
默认页面信息部分
**************************************************************************************************/
function body_infomation()
{
?>
<br>
<table width="90%" border="0" cellpadding="3" cellspacing="1" class="yc" >
  <tr>
    <td colspan="5" class="title">系统要求</td>
  </tr>
  <tr>
    <td width="50%" colspan="2">&nbsp;PHP版本要求：<font color=red>5.0以上</font></td>
    <td colspan="3">&nbsp;MYSQL版本要求：<font color=red>5.0以上</font></td>
  </tr>
  <tr>
    <td colspan="5" class="title"><div align="center" class="title"> 信息统计</div></td>
  </tr>
  <tr>
    <td colspan="5" class="title3">&nbsp;本程序由 <a href="http://www.reeyee.cn/" target="_blank">锐意先行(reeyee)</a> 授权给 <?=WEB_NAME?> 使用，当前使用版本为 <?=ATHENA_VERSION?>，数据库为 MYSQL</td>
  </tr>
  
  <tr>
    <td width="50%" colspan="2">&nbsp;服务器类型：<?=$_SERVER['SERVER_SOFTWARE']?></td>
    <td colspan="3">&nbsp;脚本解释引擎：PHP <?=phpversion();?></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;服务器名称：<?=$_SERVER['SERVER_NAME']?></td>
    <td colspan="3">&nbsp;服务器IP：<?=isset($_SERVER['SERVER_ADDR'])?$_SERVER['SERVER_ADDR']:""?></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;站点物理路径：<?=$_SERVER['SERVER_SOFTWARE']?> </td>
    <td colspan="3">&nbsp;虚拟路径：<?print($_SERVER["DOCUMENT_ROOT"]);?></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;HTTP版本：<?print($_SERVER["SERVER_PROTOCOL"]);?> </td>
    <td colspan="3"></td>
  </tr>
  <tr>
    <td colspan="5" class="title3">&nbsp;</td>
  </tr>
</table>

<?
}

/**************************************************************************************************
输出功能列表
**************************************************************************************************/
function PrintTree(&$row,$root=0,$deep=1,$type=0)
{
	global $Athena_Model;
	for($i=0;$i<count($row);$i++)
	{
		if($row[$i]['Root'] == $root)
		{
			print("<tr>");
			print("<td width=\"0\" style=\"text-align:center\">");
			if($row[$i]['Type'] == "S")
				print("<input type=\"checkbox\" name=\"id[]\" value=\"".$row[$i]['Id']."\" disabled>");
			else
				print("<input type=\"checkbox\" name=\"id[]\" value=\"".$row[$i]['Id']."\">");
			print("<td>");
			for($j=1;$j<$deep;$j++)
				print("&nbsp;&nbsp;");
			print("<a href=\"".ATHENA_SCRIPT_INDEX."?Model=".$Athena_Model."&cmd=edit&Id=".$row[$i]['Id']."\">");
			print($row[$i]['Name']);

			print("</a></td><td style=\"text-align:center\">");
			if($row[$i]['Type'] == "S")
				print("系统");
			else
				print("组件");
			print("&nbsp;</td><td>");
			print($row[$i]['Href']);
			print("&nbsp;</td><td>");
			print($row[$i]['Content']);
			if($type == 1)
			{
				print("&nbsp;</td><td style=\"text-align:center\">");
				if($row[$i]['view'] == 1)
					print("是");
			}
			print("&nbsp;</td></tr>");

			PrintTree($row,$row[$i]['Id'],$deep+1,$type);
		}
	}
}
/**************************************************************************************************
提示信息
参数
**************************************************************************************************/
function showmessage($message,$meta='')
{
?>
<table class="AthenaManage" >
  <tr>
    <td Id="ManageTip">提示信息</td>
    <td Id="ManageContent"></td>
  </tr>
  <tr>
    <td colspan="2" Id="ManageBg">
    <table  border="0" cellpadding="0" cellspacing="1" >
	  <tr><td height="8"></td></tr>
	</table>
	<table Class="AthenaManageTable" height="200">
	  <form name="frmList" method="POST" action="<?=$_SERVER['REQUEST_URI']?>">
	  <tr>
	    <td style="text-align:center">
		<?=$message?><br><br>
		<?
		if ($meta == "")
		{
			$url = $_SERVER["HTTP_REFERER"];
			print("<a href=\"$url\">&lt;&lt;返回上一页</a>");
			print("<meta http-equiv=\"refresh\" content=\"2;url=$url\">");
		}
		else
		{
			print("<a href=\"$meta\">&lt;&lt;点击返回</a>");
			print("<meta http-equiv=\"refresh\" content=\"2;url=$meta\">");
		}
		?>
		</td>
	  </tr>
	  </form>
   </table></td>
  </tr>
  <tr>
    <td colspan="2" Id="ManageBottom">&nbsp;
	</td>
  </tr>
</table>
<br>
<?
	exit;
}

/**************************************************************************************************
输出表单值
**************************************************************************************************/
function PrintTextValue($text)
{
	print(str_replace(array('"'),array('&quot;'), $text));
}

?>